package com.zhuiyun.pm.client.order.mapper;

import com.zhuiyun.pm.client.order.entity.ClientOrder;
import com.zhuiyun.pm.config.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<ClientOrder> {

/**
 * 订单mapper
 * @author 温
 * @date 2023/3/17 11:32
 * @parameter [id]
 * @return com.zhuiyun.pm.client.dingdan.entity.ClientOrder
 */
    @Select("select a.*, b.client_address AS addressA,b.consignee_name AS addressName," +
            "b.region_type AS typeA,b.client_phone AS phoneA,b.detailed_address AS addressfromA  FROM client_order a \n" +
            "left join  client_address b \n" +
            "on a.address_id = b.id \n")
    @Results({
            @Result(property = "bidder" , column = "bidder"),
            @Result(property = "productId" , column = "product_id"),
            @Result(property = "productName" , column = "product_name"),
            @Result(property = "quantity" , column = "quantity"),
            @Result(property = "startingPrice" , column = "starting_price"),
            @Result(property = "transactionPrice" , column = "transaction_price"),
            @Result(property = "earnestMoney" , column = "earnest_money"),
            @Result(property = "commissionRate" , column = "commission_rate"),
            @Result(property = "deliveryType" , column = "delivery_type"),
            @Result(property = "deliveryPoints" , column = "delivery_points"),
            @Result(property = "orderFlag" , column = "order_flag"),
            @Result(property = "addressA" , column = "addressA"),
            @Result(property = "addressName" , column = "addressName"),
            @Result(property = "typeA" , column = "typeA"),
            @Result(property = "phoneA" , column = "phoneA"),
            @Result(property = "addressfromA" , column = "addressfromA"),
            @Result(property = "addressName" , column = "consignee_name"),
            @Result(property = "addressId" , column = "address_id"),
            @Result(property = "orderNumber" , column = "order_number"),
            @Result(property = "delFlag" , column = "del_flag"),
            @Result(property = "transactionTotal" , column = "transaction_total"),
            @Result(property = "creationTime" , column = "creation_time"),
            @Result(property = "updateTime" , column = "update_time"),
            @Result(property = "strikeTime" , column = "strike_time"),
            @Result(property = "userId" , column = "user_id"),
            @Result(property = "consigneeName" , column = "consignee_name"),
            @Result(property = "clientAddress" , column = "client_address"),
            @Result(property = "clientPhone" , column = "client_phone"),
            @Result(property = "clientEconomize" , column = "client_economize"),
            @Result(property = "clientCity" , column = "client_city"),
            @Result(property = "clientCounty" , column = "client_county"),
            @Result(property = "detailedAddress" , column = "detailed_address"),
            @Result(property = "regionType" , column = "region_type")
    })
    ClientOrder clientList(int id);


}
